﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NGS.BioSequenceIO
{
    public static class NgsFileSelector
    {
        public static INgsReader OpenSeqFile(string filename)
        {
            return (INgsReader)new TxtNgsReader(filename);
        }
        public static INgsReader OpenFile(string filename)
        {
            if (filename.IndexOf(".fastq") >= 0 || filename.IndexOf(".fq") >= 0 || filename.IndexOf(".txt") >= 0) return (INgsReader)new FastqNgsReader(filename);
            if (filename.IndexOf(".fasta") >= 0 || filename.IndexOf(".fa") >= 0) return (INgsReader)new FastaNgsReader(filename);
            return (INgsReader)new TxtNgsReader(filename);
        }
    }
}
